HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: /var/www/kevin-demo/wp-content/plugins/sg-security/vendor/pragmarx/random/src/Faker.php
<?php

namespace PragmaRX\Random;

trait Faker
{
    protected $fakerClass = 'Faker\Factory';

    protected $faker;

    protected $fakerString;

    /**
     * Call faker.
     *
     * @param $name
     * @param $arguments
     * @return mixed
     * @throws \Exception
     */
    public function __call($name, $arguments)
    {
        try {
            $this->fakerString = $this->getFaker()->{$name}(...$arguments);
        } catch (\Error $e) {
            throw new \Exception('Faker is not installed. Call to undefined method PragmaRX\Random\Random::'.$name);
        }

        return $this;
    }

    /**
     * Instantiate and get Faker.
     *
     * @return \Faker\Generator|null
     */
    public function getFaker()
    {
        if (is_null($this->faker) && class_exists($this->fakerClass)) {
            $this->faker = call_user_func("$this->fakerClass::create");
        }

        return $this->faker;
    }

    /**
     * Set the faker class.
     *
     * @param $class
     * @return $this
     */
    public function fakerClass($class)
    {
        $this->fakerClass = $class;

        return $this;
    }
}